Namespace - LJCNetCommon
Parameters
text - The text value.
addIndent - Indicates if the text can be indented.
allowNewLine - Indicates if a new line can be added.
Returns
The potentially indented and wrapped new text value.
Syntax
C# |
public String GetText(String text, Boolean addIndent = True, Boolean allowNewLine = True)
|
Gets potentially indented and wrapped text.
Remarks
GetText() is a "GetString" method. It creates and returns the potentially
indented and wrapped text. It will start the returned text with a new line
if the builder already has text.
The applied indent is the product of the class properties IndentCount
and IndentCharCount. (IndentCount * IndentCharCount).
The "addIndent" parameter defaults to true. Set it to false to prevent
indenting the line further.
The "allowNewLine" parameter defaults to true. Set it to false to prevent
starting with a new line.
Wraps the text with a newline if the WrapEnabled parameter is true and the
line length is greater than LineLimit.
Example
C# |
var tb = new TextBuilder();
tb.Text("This is an appended line.");
tb.AddIndent();
var tempText = tb.GetText("This is an indented line.");
tb.AddText(tempText);
var result = tb.ToString();
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.